cmake_minimum_required(VERSION 2.8.11)
project(lianxie)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

find_package(Qt5Widgets)
set(XF_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../include" ${XF_INCLUDE_DIRS})
set(XF_LIBRARY_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../libs/x64" ${XF_LIBRARY_DIRS})

include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}
     ${XF_INCLUDE_DIRS}   
     )
link_directories(
    ${XF_LIBRARY_DIRS}
)
    
qt5_wrap_ui(ui_FILES
    mainwindow.ui    

     )
  
set(lianxie_SRCS xianshi.cpp
    mainwindow.cpp
    main.cpp
     ${ui_FILES}
     mainwindow.h
     xianshi.h
     )

add_executable(lianxie ${lianxie_SRCS})

 # Use the Widgets module from Qt 5  
qt5_use_modules(lianxie Widgets)
target_link_libraries(lianxie Qt5::Widgets
    ${XF_LIBRARY_DIRS}
    -lshuxie
    )
install(TARGETS lianxie RUNTIME DESTINATION bin)

qt5_wrap_ui(ui_game_FILES
         dialog_game.ui
         dialog_fenshu.ui
     )
qt5_add_resources(qrc_game_FILES resource.qrc)
set(game_xiezi_SRCS
    xianshi.cpp
     ${ui_game_FILES}
     ${qrc_game_FILES}
     xianshi.h
     dialog_game.cpp
     dialog_game.h
     main_game.cpp
     dialog_fenshu.cpp
     dialog_fenshu.h
     )

add_executable(game-xiezi ${game_xiezi_SRCS})

 # Use the Widgets module from Qt 5
qt5_use_modules(game-xiezi Widgets)
target_link_libraries(game-xiezi Qt5::Widgets
    ${XF_LIBRARY_DIRS}
    -lshuxie
    )
install(TARGETS game-xiezi RUNTIME DESTINATION bin)
